package com.lsc.record.common;

/**
 * 用于内部需要获取bool的结果也需要获取异常信息
 */
public class BooleanResult {
	
	private boolean result;
	
	private String message;
	
	public boolean isResult() {
		return result;
	}

	public void setResult(boolean result) {
		this.result = result;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
	public static BooleanResult success() {
		BooleanResult result = new BooleanResult();
		result.setResult(true);
		result.setMessage("处理完成");
		return result;
	}
	
	public static BooleanResult success(String message) {
		BooleanResult result = new BooleanResult();
		result.setResult(true);
		result.setMessage(message);
		return result;
	}
	
	public static BooleanResult error() {
		BooleanResult result = new BooleanResult();
		result.setResult(true);
		result.setMessage("处理失败");
		return result;
	}
	
	public static BooleanResult error(String message) {
		BooleanResult result = new BooleanResult();
		result.setResult(true);
		result.setMessage(message);
		return result;
	}
}
